package com.buaa.divinationmaster.model;

/**
 * 占卜记录数据模型
 * 对应需求文档中的divination_history数据表
 */
public class DivinationRecord {
    private long id;                    // 主键ID
    private String type;                // 占卜类型（tarot/meihua/coin/lenormand）
    private String question;            // 用户问题
    private String resultData;          // 结果数据（JSON格式）
    private String interpretation;      // 解读文本
    private long timestamp;             // 占卜时间戳
    private boolean isFavorite;         // 是否收藏
    private String tags;                // 标签（多个用逗号分隔）
    
    // 构造函数
    public DivinationRecord() {}
    
    public DivinationRecord(String type, String question, String resultData, 
                           String interpretation, long timestamp) {
        this.type = type;
        this.question = question;
        this.resultData = resultData;
        this.interpretation = interpretation;
        this.timestamp = timestamp;
        this.isFavorite = false;
    }
    
    // Getters and Setters
    public long getId() { return id; }
    public void setId(long id) { this.id = id; }
    
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    
    public String getQuestion() { return question; }
    public void setQuestion(String question) { this.question = question; }
    
    public String getResultData() { return resultData; }
    public void setResultData(String resultData) { this.resultData = resultData; }
    
    public String getInterpretation() { return interpretation; }
    public void setInterpretation(String interpretation) { this.interpretation = interpretation; }
    
    public long getTimestamp() { return timestamp; }
    public void setTimestamp(long timestamp) { this.timestamp = timestamp; }
    
    public boolean isFavorite() { return isFavorite; }
    public void setFavorite(boolean favorite) { isFavorite = favorite; }
    
    public String getTags() { return tags; }
    public void setTags(String tags) { this.tags = tags; }
    
    /**
     * 获取占卜类型的显示名称
     */
    public String getTypeDisplayName() {
        switch (type) {
            case "tarot": return "塔罗牌占卜";
            case "meihua": return "梅花易数";
            case "coin": return "金钱卦";
            case "lenormand": return "雷诺曼卡牌";
            default: return "未知占卜";
        }
    }
    
    /**
     * 获取占卜类型的图标
     */
    public String getTypeIcon() {
        switch (type) {
            case "tarot": return "🃏";
            case "meihua": return "✨";
            case "coin": return "🪙";
            case "lenormand": return "🍀";
            default: return "🔮";
        }
    }
}
